import request from '@/utils/request';


const Api = {
  menu: '/menu',
  log: '/log',
  role: '/role',
};


export const getMenu = (params: any) => {
  return request({
    url: Api.menu,
    method: 'get',
    params: params,
  });
};

export const postMenu = (data: any) => {
    return request({
      url: Api.menu,
      method: 'post',
      data: data,
    });
};

export const deleteMenu = (params: any) => {
  return request({
    url: Api.menu + '/' + params.id,
    method: 'delete',
  });
};

export const putMenu = (data: any) => {
  return request({
    url: Api.menu,
    method: 'put',
    data: data,
  });
};

export const getLog = (params: any) => {
  return request({
    url: Api.log,
    method: 'get',
    params: params,
  });
};

export const getRole = (params: any) => {
  return request({
    url: Api.role,
    method: 'get',
    params: params,
  });
};

export const postRole = (data: any) => {
  return request({
    url: Api.role,
    method: 'post',
    data: data,
  });
};

export const deleteRole = (params: any) => {
  return request({
    url: Api.role + '/' + params.id,
    method: 'delete',
  });
};

export const putRole = (data: any) => {
  return request({
    url: Api.role,
    method: 'put',
    data: data,
  });
};


